#!/bin/bash
export BUILD_ID=dontkillme
mvn package
kill -9 $(ps aux | grep tomcat | grep -v grep | awk '{print $2}')
rm /opt/tomcat8/webapps/ROOT* -rf
cp target/virstu.war /opt/tomcat8/webapps/ROOT.war
/opt/tomcat8/bin/startup.sh
while true; do
 check=$(netstat -anp | grep 80 -w)
 if [ -z "$check" ]; then 
  sleep 3
 else 
   break
 fi
done 
curl -s http://10.10.10.71/cgi-bin/liststu.sh
if [ $? -eq 0 ];then
 echo "项目包没问题"
else 
 echo "项目包有问题"
fi
